<?
// *************************************
// * resources.php allows the admin to
// * View and Delete resources and view
// * resource stats.
// *************************************
$jsFile = "jsResourcesOther.php";
set_time_limit(3600);
include("includes/functions.php");
include("includes/sajax/sajax.php");
include("includes/sajax/sajaxResourcesOther.php");
sajax_init();

sajax_export("addConference");
sajax_export("editConference");
sajax_export("editConferenceConfirm");
sajax_export("getConferences");
sajax_export("addNewsletter");
sajax_export("getNewsletters");
sajax_export("editNewsletter");
sajax_export("editNewsletterConfirm");
sajax_export("getServiceProviders");
sajax_export("deleteItem");
sajax_export("toggleActive");
sajax_handle_client_request();

getConferences();
getNewsletters();
getServiceProviders();
// Parse returned strings
$conferenceArray = explode('|',$returnConferences);
$newsletterArray = explode('|',$returnNewsletters);

$returnConferences = $conferenceArray[0];
$returnNewsletters = $newsletterArray[0];

include("includes/header.php"); ?>
<script language="javascript" type="text/javascript" src="<?=$pre; ?>js/tinyeditor/config/config<?=$richtext; ?>.js"></script>
	<div id="content0">
		<div id="buttonNew" style="float: left; width: 180px;"><input type="button" class="buttonBig buttonAddBig" value="New Link" onClick="addResource();" title="Add new resource" id="buttonAddResource" /></div>
		<div id="statusDiv" style="float: left;"></div>
		<div style="clear: left; height: 10px;"></div>
		<div id="formNewResource" class="blueBox" style="display: none;">
			<input type="hidden" id="formAction" />
			<input type="hidden" id="linkID" />
			<input type="hidden" id="pathID" />
			
			<p><label class="vertLabel">Title</label>
			<input type="text" style="width: 400px;" id="pTitleBox" name="pTitleBox" /></p>
			
			<p><label class="vertLabel">Link URL</label>
			<input type="text" style="width: 400px;" value="http://" id="pURL" name="pURL" /></p>
						
			<p><label class="vertLabel">Short description</label>
			<textarea name="pShortDesc" id="pShortDesc" class="somewhatAdvanced" style="width: 100%; height: 200px;"></textarea>
			</p>
			
			<!--<p><label class="vertLabel">Short description</label>
			<textarea name="pShort" id="pShort" class="editorAdvanced" style="width: 100%; height: 200px;"></textarea>
			</p>-->
			<p><label>Associated categories for resource</label>
				<? toolTip('productFiles'); echo $toolTip; ?>
			</p>		
			<div id="catContainer">
				<div id="associatedCatContainer" style="margin-top: 10px;"></div>
				<div id="newCat">
					<table>
					<tr>
						<td id="selectParent"></td>
						<td id="pathSave" style="display: none;"><input type="image" onClick="addResourceCat();" src="images/button_add.gif" style="border: none;" title="Add resource category" /></td>
					</tr>
					</table>								
				</div>				
			</div>
			
			<p style="margin-top: 15px; margin-left: 6px;">
				<input type="button" class="buttonBig buttonSaveBig" onClick="saveResource();" value="Save" title="Save resource" />
				<input type="button" class="buttonBig buttonCancelBig" onClick="cancelResource();" value="Cancel" title="Cancel" />
			</p>
		</div>		
		
		<div id="pageContent">
			<div id="pageHeader"><h1 class="headerUsers">TCN Resource Manager</h1></div>
			<div id="ts"></div>
					
			<div id="warning"></div>
			<div class="popupWindow" id="addEditConference" style="display: none;"></div>
			<p></p>
			<div id="conference"><?=$returnConferences; ?></div>
			
			<p></p>
			<div class="popupWindow" id="addEditNewsletter" style="display: none;"></div>
			<p></p>
			<div id="newsletter"><?=$returnNewsletters; ?></div>
			
			<p></p>
			<div class="popupWindow" id="addEditServiceProviders" style="display: none;"></div>
			<p></p>
			<div id="serviceProvider"><?=$returnServiceProviders; ?></div>
		</div>
		<div style="clear: left;"><br /></div>
		
	</div>
	
	<div id="content1"></div>
	<div id="content2">
		<input type="button" onClick="linkCheck();" value="Check Links" />
	</div>
	<div id="south" class="x-layout-inactive-content">
	south - generally for informational stuff, also could be for status bar
	</div>
<? include("includes/footer.php"); ?>
